#include <stdio.h>
#include <stdlib.h>
#include <string.h>

//结构体成员为指针类型
struct student
{
    char *name;
    int age;
    int *scores;
};

int main()
{
    struct student stu;
    stu.name = (char *)malloc(sizeof(char) * 21);
    stu.scores = (int *)malloc(sizeof(int) * 3);
    strcpy(stu.name, "张三");
    stu.age = 18;
    stu.scores[0] = 88;
    stu.scores[1] = 99;
    stu.scores[2] = 100;

    printf("%s\n", stu.name);
    printf("%d\n", stu.age);
    printf("%d\n", stu.scores[0]);
    printf("%d\n", stu.scores[1]);
    printf("%d\n", stu.scores[2]);
    free(stu.name);
    free(stu.scores);
    return 0;
}